#ifndef BFILE_H
#define BFILE_H
#include <stdio.h>
#include <stdint.h>

class BFile
{
public:
    BFile();
    ~BFile();

    int open(const char* fname, const char* mode);
    int close();

    int64_t read(void *ptr, int64_t size, int64_t nmemb);
    int64_t write(const void *ptr, int64_t size, int64_t nmemb);

    int64_t length();

    int seek(int64_t offset, int whence);
    int64_t tell();

private:
    FILE* file;
};

#endif // BFILE_H
